public void writeExternal(java.io.DataOutput out) throws java.io.IOException { out.writeLong(bean.f_key); out.writeInt(bean.f_type); if( bean.f_meta!=null ) { out.writeInt(bean.f_meta.getLength()); out.write(bean.f_meta.getData(), bean.f_meta.getOffset(), bean.f_meta.getLength()); } else { out.writeInt(-1); } }
static public String decode(Buffer value) { int size = value.getLength(); char rc[] = new char[size]; for( int i=0; i < size; i++ ) { rc[i] = (char)(value.get(i) & 0xFF ); } return new String(rc); }
public void writeExternal(java.io.DataOutput out) throws java.io.IOException { out.writeLong(bean.f_collectionKey); if( bean.f_entryKey!=null ) { out.writeInt(bean.f_entryKey.getLength()); out.write(bean.f_entryKey.getData(), bean.f_entryKey.getOffset(), bean.f_entryKey.getLength()); } else { out.writeInt(-1); } }
public void writeExternal(java.io.DataOutput out) throws java.io.IOException { out.writeLong(bean.f_key); out.writeInt(bean.f_type); if( bean.f_meta!=null ) { out.writeInt(bean.f_meta.getLength()); out.write(bean.f_meta.getData(), bean.f_meta.getOffset(), bean.f_meta.getLength()); } else { out.writeInt(-1); } }
public void writeExternal(java.io.DataOutput out) throws java.io.IOException { out.writeLong(bean.f_key); out.writeInt(bean.f_type); if( bean.f_meta!=null ) { out.writeInt(bean.f_meta.getLength()); out.write(bean.f_meta.getData(), bean.f_meta.getOffset(), bean.f_meta.getLength()); } else { out.writeInt(-1); } }
public void writeExternal(java.io.DataOutput out) throws java.io.IOException { out.writeLong(bean.f_key); out.writeInt(bean.f_type); if( bean.f_meta!=null ) { out.writeInt(bean.f_meta.getLength()); out.write(bean.f_meta.getData(), bean.f_meta.getOffset(), bean.f_meta.getLength()); } else { out.writeInt(-1); } }
static public String decode(Buffer value) { int size = value.getLength(); char rc[] = new char[size]; for( int i=0; i < size; i++ ) { rc[i] = (char)(value.get(i) & 0xFF ); } return new String(rc); }
public void writeExternal(java.io.DataOutput out) throws java.io.IOException { out.writeLong(bean.f_key); out.writeInt(bean.f_type); if( bean.f_meta!=null ) { out.writeInt(bean.f_meta.getLength()); out.write(bean.f_meta.getData(), bean.f_meta.getOffset(), bean.f_meta.getLength()); } else { out.writeInt(-1); } }
public void writeExternal(java.io.DataOutput out) throws java.io.IOException { out.writeLong(bean.f_collectionKey); if( bean.f_entryKey!=null ) { out.writeInt(bean.f_entryKey.getLength()); out.write(bean.f_entryKey.getData(), bean.f_entryKey.getOffset(), bean.f_entryKey.getLength()); } else { out.writeInt(-1); } }
static public String decode(Buffer value) { int size = value.getLength(); char rc[] = new char[size]; for( int i=0; i < size; i++ ) { rc[i] = (char)(value.get(i) & 0xFF ); } return new String(rc); }
public void writeExternal(java.io.DataOutput out) throws java.io.IOException { out.writeLong(bean.f_collectionKey); if( bean.f_entryKey!=null ) { out.writeInt(bean.f_entryKey.getLength()); out.write(bean.f_entryKey.getData(), bean.f_entryKey.getOffset(), bean.f_entryKey.getLength()); } else { out.writeInt(-1); } }
public String contentAsString() { try { return new String(content.getData(), content.getOffset(), content.getLength(), "UTF-8"); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); // Not expected } }
static public String decode(Buffer buffer) { try { return new String(buffer.getData(), buffer.getOffset(), buffer.getLength(), "UTF-8"); } catch (UnsupportedEncodingException e) { throw new RuntimeException("A UnsupportedEncodingException was thrown for teh UTF-8 encoding. (This should never happen)"); } }
static public String decode(Buffer buffer) { try { return new String(buffer.getData(), buffer.getOffset(), buffer.getLength(), "UTF-8"); } catch (UnsupportedEncodingException e) { throw new RuntimeException("A UnsupportedEncodingException was thrown for teh UTF-8 encoding. (This should never happen)"); } }
/** * reset the <code>StoreByteArrayInputStream</code> to use an new * Buffer * * @param buffer */ public void restart(Buffer buffer) { this.buf = buffer.getData(); this.offset = buffer.getOffset(); this.pos = this.offset; this.length = buffer.getLength(); }
/** * reset the <code>StoreByteArrayInputStream</code> to use an new * Buffer * * @param buffer */ public void restart(Buffer buffer) { this.buf = buffer.getData(); this.offset = buffer.getOffset(); this.pos = this.offset; this.length = buffer.getLength(); }
public String getText() throws JMSException { Buffer buffer = getContent(); if (text == null && buffer != null) { this.text = new String(buffer.getData(), buffer.getOffset(), buffer.getLength()); setContent(null); } return text; }
private void initializeReading() throws JMSException { checkWriteOnlyBody(); if (dataIn == null) { Buffer buffer = getContent(); if (buffer==null) { buffer = new Buffer(0); } dataIn = new DataInputStream(new ByteArrayInputStream(buffer)); this.length = buffer.getLength(); } }