public override java.nio.LongBuffer duplicate() { java.nio.ByteBuffer bb = byteBuffer.duplicate().order(byteBuffer.order()); java.nio.LongToByteBufferAdapter buf = new java.nio.LongToByteBufferAdapter(bb); buf._limit = _limit; buf._position = _position; buf._mark = _mark; return(buf); }
/// <summary> /// Copies a string to ByteBuffer, if byteBuffer overflows then not all of string /// is copied /// </summary> /// <param name="string"/> /// <param name="byteBuffer">destination buffer is duplicated first so that position is not list /// </param> /// <returns>new byteBuffer</returns> public static java.nio.ByteBuffer copy(string @string, java.nio.ByteBuffer byteBuffer ) { java.nio.ByteBuffer dupe = byteBuffer.duplicate(); for (int i = 0; i < @string.Length && dupe.hasRemaining(); i++) { dupe.put(unchecked ((byte)@string[i])); } return(dupe); }
public ArrayOutputStream(java.nio.ByteBuffer buf) { this.buf = buf.duplicate(); }