public void writeUTF(String text) throws IOException { long encodedsize = MarshallingSupport.countUTFBytes(text); if (encodedsize > 65535) { throw new UTFDataFormatException("encoded string too long: " + encodedsize + " bytes"); } ensureEnoughBuffer((int)(pos + encodedsize + 2)); writeShort((int)encodedsize); byte[] buffer = new byte[(int)encodedsize]; MarshallingSupport.writeUTFBytesToBuffer(text, (int) encodedsize, buf, pos); pos += encodedsize; }
public synchronized byte[] getEncodedXidBytes() { if (encodedXidBytes == null) { outputStream = new DataByteArrayOutputStream(XID_PREFIX_SIZE + globalTransactionId.length + branchQualifier.length); outputStream.position(10); outputStream.writeInt(formatId); // global length outputStream.writeShort(globalTransactionId.length); try { outputStream.write(globalTransactionId); outputStream.write(branchQualifier); } catch (IOException fatal) { throw new RuntimeException(this + ", failed to encode:", fatal); } encodedXidBytes = outputStream.getData(); } return encodedXidBytes; }
public void writeUTF(String text) throws IOException { long encodedsize = MarshallingSupport.countUTFBytes(text); if (encodedsize > 65535) { throw new UTFDataFormatException("encoded string too long: " + encodedsize + " bytes"); } ensureEnoughBuffer((int)(pos + encodedsize + 2)); writeShort((int)encodedsize); byte[] buffer = new byte[(int)encodedsize]; MarshallingSupport.writeUTFBytesToBuffer(text, (int) encodedsize, buf, pos); pos += encodedsize; }
writeShort(encodedsize); int i = 0; for (i = 0; i < strlen; i++) {
public void writeUTF(String text) throws IOException { long encodedsize = MarshallingSupport.countUTFBytes(text); if (encodedsize > 65535) { throw new UTFDataFormatException("encoded string too long: " + encodedsize + " bytes"); } ensureEnoughBuffer((int)(pos + encodedsize + 2)); writeShort((int)encodedsize); byte[] buffer = new byte[(int)encodedsize]; MarshallingSupport.writeUTFBytesToBuffer(text, (int) encodedsize, buf, pos); pos += encodedsize; }
public void writeUTF(String text) throws IOException { long encodedsize = MarshallingSupport.countUTFBytes(text); if (encodedsize > 65535) { throw new UTFDataFormatException("encoded string too long: " + encodedsize + " bytes"); } ensureEnoughBuffer((int)(pos + encodedsize + 2)); writeShort((int)encodedsize); byte[] buffer = new byte[(int)encodedsize]; MarshallingSupport.writeUTFBytesToBuffer(text, (int) encodedsize, buf, pos); pos += encodedsize; }
public synchronized byte[] getEncodedXidBytes() { if (encodedXidBytes == null) { outputStream = new DataByteArrayOutputStream(XID_PREFIX_SIZE + globalTransactionId.length + branchQualifier.length); outputStream.position(10); outputStream.writeInt(formatId); // global length outputStream.writeShort(globalTransactionId.length); try { outputStream.write(globalTransactionId); outputStream.write(branchQualifier); } catch (IOException fatal) { throw new RuntimeException(this + ", failed to encode:", fatal); } encodedXidBytes = outputStream.getData(); } return encodedXidBytes; }
public synchronized byte[] getEncodedXidBytes() { if (encodedXidBytes == null) { outputStream = new DataByteArrayOutputStream(XID_PREFIX_SIZE + globalTransactionId.length + branchQualifier.length); outputStream.position(10); outputStream.writeInt(formatId); // global length outputStream.writeShort(globalTransactionId.length); try { outputStream.write(globalTransactionId); outputStream.write(branchQualifier); } catch (IOException fatal) { throw new RuntimeException(this + ", failed to encode:", fatal); } encodedXidBytes = outputStream.getData(); } return encodedXidBytes; }
public synchronized byte[] getEncodedXidBytes() { if (encodedXidBytes == null) { outputStream = new DataByteArrayOutputStream(XID_PREFIX_SIZE + globalTransactionId.length + branchQualifier.length); outputStream.position(10); outputStream.writeInt(formatId); // global length outputStream.writeShort(globalTransactionId.length); try { outputStream.write(globalTransactionId); outputStream.write(branchQualifier); } catch (IOException fatal) { throw new RuntimeException(this + ", failed to encode:", fatal); } encodedXidBytes = outputStream.getData(); } return encodedXidBytes; }