Write to a OAD characteristic

@param charc The characteristic being inspected
@return      true if it's the OAD Block characteristic
161932
private boolean writeToCharacteristic(BluetoothGattCharacteristic charc, byte[] data) {
        charc.setValue(data);
        boolean result = mGattClient.writeCharacteristic(charc);
        if (result) {
            Log.d(TAG, "Wrote to characteristic: " + charc.getUuid() +
                    ", data: " + Arrays.toString(data));
        } else {
            Log.e(TAG, "Write failed to characteristic: " + charc.getUuid() +
                    ", data: " + Arrays.toString(data));
        }
        return result;
    }
6256
@Override
	public boolean write(Writer writer) throws IOException {

		writeBlock(writer, EmblPadding.PA_PADDING, accession);

		return true;
	}
122122
public void write(char ... data) throws IllegalStateException, IOException{
        write(StandardCharsets.US_ASCII, CharBuffer.wrap(data));
    }
294732
protected boolean write(ByteBuffer buffer) throws IOException{
        while(buffer.hasRemaining()){
            if(out.write(buffer)==0){
                out.addWriteInterest();
                return false;
            }
        }
        return true;
    }
36086
public void write(int c) {
        if (c != -1) {
            current.append((char)c);
        }
        if (c == '\n') {
            current = new StringBuilder();
            lines.add(current);
        }
    }
1073074
public void write(char[] c, int off, int len) {

        ensureRoom(len * 2);

        for (int i = off; i < len; i++) {
            int v = c[i];

            buffer[count++] = (byte) (v >>> 8);
            buffer[count++] = (byte) v;
        }
    }
571538
@Override
    public StringWriter append(char c) {
		if (c == '\n') {
			if (!ignoreNewLine) {
				++line;
				column = 0;
			}
			ignoreNewLine = false;
		} else if (c == '\r'){
			// \r\n sequence should be treated as a single line feed so set a flag
			// to indicate that if the next character is a /n then we should ignore it
			ignoreNewLine = true;
			++line;
			column = 0;
		} else {
			ignoreNewLine = false;
			++column;
		}
        super.write(c);
        return this;
    }
24901
public void write(int c) throws IOException {
        synchronized (lock) {
            ensureOpen();
            if (nextChar >= nChars)
                flushBuffer();
            cb[nextChar++] = (char) c;
        }
    }
729851
public static boolean isSafeChar(char ch) {
        if (ch >= 'a' && ch <= 'z')
            return true;
        if (ch >= 'A' && ch <= 'Z')
          return true;
        if (ch >= '0' && ch <= '9')
          return true;
        // loop thru our PRINTABLE string
        for (int i = 0; i < SAFE.length(); i++) {
            if (ch == SAFE.charAt(i))
                return true;
        }
        return false;
    }
102172
public static boolean isGraphic(char c) {
        int gc = Character.getType(c);
        return     gc != Character.CONTROL
                && gc != Character.FORMAT
                && gc != Character.SURROGATE
                && gc != Character.UNASSIGNED
                && gc != Character.LINE_SEPARATOR
                && gc != Character.PARAGRAPH_SEPARATOR
                && gc != Character.SPACE_SEPARATOR;
    }
783623
public void writeCharacters(char[] text, int start, int len)
			throws XMLStreamException {
		this.writeCharacters(new String(text, start, len));
	}
1355077
public void write(ByteAppendable os, char ch)
    throws IOException
  {
    os.write(ch >> 8);
    os.write(ch);
  }
625750
public synchronized void write(int c) throws IOException {

        checkClosed();

        int newcount = count + 1;

        if (newcount > buf.length) {
            buf = copyOf(buf, Math.max(buf.length << 1, newcount));
        }

        buf[count] = (char) c;
        count      = newcount;
    }
90819
private void write(int c) throws IOException {
		if (!firstCharacterWritten) {
			if (c != '\n') {
				out.write(c);
				firstCharacterWritten = true;
			}
		} else {
			out.write(c);
		}
	}
462829
protected boolean writeStdCompare(int type, boolean simulate) {
        type = type-COMPARE_NOT_EQUAL;
        // look if really compare
        if (type<0||type>7) return false;

        if (!simulate) {
            MethodVisitor mv = getController().getMethodVisitor();
            OperandStack operandStack = getController().getOperandStack();
            // operands are on the stack already
            int bytecode = stdCompareCodes[type];
            Label l1 = new Label();
            mv.visitJumpInsn(bytecode,l1);
            mv.visitInsn(ICONST_1);
            Label l2 = new Label();
            mv.visitJumpInsn(GOTO, l2);
            mv.visitLabel(l1);
            mv.visitInsn(ICONST_0);
            mv.visitLabel(l2);
            operandStack.replace(ClassHelper.boolean_TYPE, 2);
        }
        return true;
    }
1152980
private void _prependOrWriteCharacterEscape(char ch, int escCode)
			throws IOException, JsonGenerationException
	{
		if (escCode >= 0) { // \\N (2 char)
			if (_outputTail >= 2) { // fits, just prepend
				int ptr = _outputTail - 2;
				_outputHead = ptr;
				_outputBuffer[ptr++] = '\\';
				_outputBuffer[ptr] = (char) escCode;
				return;
			}
			// won't fit, write
			char[] buf = _entityBuffer;
			if (buf == null) {
				buf = _allocateEntityBuffer();
			}
			_outputHead = _outputTail;
			buf[1] = (char) escCode;
			_writer.write(buf, 0, 2);
			return;
		}
		if (escCode != CharacterEscapes.ESCAPE_CUSTOM) { // std, \\uXXXX
			if (_outputTail >= 6) { // fits, prepend to buffer
				char[] buf = _outputBuffer;
				int ptr = _outputTail - 6;
				_outputHead = ptr;
				buf[ptr] = '\\';
				buf[++ptr] = 'u';
				// We know it's a control char, so only the last 2 chars are non-0
				if (ch > 0xFF) { // beyond 8 bytes
					int hi = (ch >> 8) & 0xFF;
					buf[++ptr] = HEX_CHARS[hi >> 4];
					buf[++ptr] = HEX_CHARS[hi & 0xF];
					ch &= 0xFF;
				} else {
					buf[++ptr] = '0';
					buf[++ptr] = '0';
				}
				buf[++ptr] = HEX_CHARS[ch >> 4];
				buf[++ptr] = HEX_CHARS[ch & 0xF];
				return;
			}
			// won't fit, flush and write
			char[] buf = _entityBuffer;
			if (buf == null) {
				buf = _allocateEntityBuffer();
			}
			_outputHead = _outputTail;
			if (ch > 0xFF) { // beyond 8 bytes
				int hi = (ch >> 8) & 0xFF;
				int lo = ch & 0xFF;
				buf[10] = HEX_CHARS[hi >> 4];
				buf[11] = HEX_CHARS[hi & 0xF];
				buf[12] = HEX_CHARS[lo >> 4];
				buf[13] = HEX_CHARS[lo & 0xF];
				_writer.write(buf, 8, 6);
			} else { // We know it's a control char, so only the last 2 chars are non-0
				buf[6] = HEX_CHARS[ch >> 4];
				buf[7] = HEX_CHARS[ch & 0xF];
				_writer.write(buf, 2, 6);
			}
			return;
		}
		String escape;

		if (_currentEscape == null) {
			escape = _characterEscapes.getEscapeSequence(ch).getValue();
		} else {
			escape = _currentEscape.getValue();
			_currentEscape = null;
		}
		int len = escape.length();
		if (_outputTail >= len) { // fits in, prepend
			int ptr = _outputTail - len;
			_outputHead = ptr;
			escape.getChars(0, len, _outputBuffer, ptr);
			return;
		}
		// won't fit, write separately
		_outputHead = _outputTail;
		_writer.write(escape);
	}
475928
private void writeLocalSymbolTable(SymbolTable symTab)
    {
        assert symTab.isLocalTable();

        final int originalOffset = myBuffer.length - myOffset;

        // Write declared local symbol strings if any exists
        writeSymbolsField(symTab);

        // Write import declarations if any exists
        writeImportsField(symTab);

        // Write the struct prefix
        writePrefix(TYPE_STRUCT, myBuffer.length - myOffset - originalOffset);

        // Write the $ion_symbol_table annotation
        byte[] ionSymbolTableByteArray = {
               (byte) (0x80 | 1),                       /* annot-length */
               (byte) (0x80 | ION_SYMBOL_TABLE_SID)     /* annot */
               };
        writeBytes(ionSymbolTableByteArray);
        writePrefix(TYPE_ANNOTATIONS,
                    myBuffer.length - myOffset - originalOffset);
    }