Searched defs:bb (Results 1 - 25 of 27) sorted by relevance

12

/libcore/ojluni/src/main/java/sun/nio/ch/
H A DChannelInputStream.java54 public static int read(ReadableByteChannel ch, ByteBuffer bb) argument
66 int n = ch.read(bb);
73 return ch.read(bb);
78 private ByteBuffer bb = null; field in class:ChannelInputStream
104 ByteBuffer bb = ((this.bs == bs)
105 ? this.bb
107 bb.limit(Math.min(off + len, bb.capacity()));
108 bb.position(off);
109 this.bb
114 read(ByteBuffer bb) argument
[all...]
H A DIOUtil.java58 ByteBuffer bb = Util.getTemporaryDirectBuffer(rem);
60 bb.put(src);
61 bb.flip();
65 int n = writeFromNativeBuffer(fd, bb, position, nd);
72 Util.offerFirstTemporaryDirectBuffer(bb);
76 private static int writeFromNativeBuffer(FileDescriptor fd, ByteBuffer bb, argument
80 int pos = bb.position();
81 int lim = bb.limit();
90 ((DirectBuffer)bb).address() + pos,
93 written = nd.write(fd, ((DirectBuffer)bb)
207 readIntoNativeBuffer(FileDescriptor fd, ByteBuffer bb, long position, NativeDispatcher nd) argument
[all...]
H A DDatagramSocketAdaptor.java145 ByteBuffer bb = ByteBuffer.wrap(p.getData(),
156 dc.write(bb);
159 dc.send(bb, p.getSocketAddress());
163 dc.send(bb, p.getSocketAddress());
174 private SocketAddress receive(ByteBuffer bb) throws IOException { argument
176 return dc.receive(bb);
186 if ((sender = dc.receive(bb)) != null)
197 if ((sender = dc.receive(bb)) != null)
222 ByteBuffer bb = ByteBuffer.wrap(p.getData(),
225 SocketAddress sender = receive(bb);
[all...]
H A DSocketAdaptor.java213 protected int read(ByteBuffer bb) argument
220 return sc.read(bb);
229 if ((n = sc.read(bb)) != 0)
240 if ((n = sc.read(bb)) != 0)
H A DUtil.java98 ByteBuffer bb = buffers[i];
99 if (bb == null)
101 if (bb.capacity() >= size) {
102 buf = bb;
346 static void erase(ByteBuffer bb) { argument
347 unsafe.setMemory(((DirectBuffer) bb).address(), bb.capacity(), (byte) 0);
H A DDatagramChannelImpl.java349 ByteBuffer bb = null;
363 bb = Util.getTemporaryDirectBuffer(dst.remaining());
366 n = receive(fd, bb);
377 bb.clear();
381 bb.flip();
382 dst.put(bb);
388 if (bb != null)
389 Util.releaseTemporaryDirectBuffer(bb);
411 ByteBuffer bb = Util.getTemporaryDirectBuffer(newSize);
415 int n = receiveIntoNativeBuffer(fd, bb, newSiz
425 receiveIntoNativeBuffer(FileDescriptor fd, ByteBuffer bb, int rem, int pos) argument
526 sendFromNativeBuffer(FileDescriptor fd, ByteBuffer bb, InetSocketAddress target) argument
[all...]
/libcore/ojluni/src/main/java/sun/security/ssl/
H A DByteBufferInputStream.java42 ByteBuffer bb; field in class:ByteBufferInputStream
44 ByteBufferInputStream(ByteBuffer bb) { argument
45 this.bb = bb;
55 if (bb == null) {
59 if (bb.remaining() == 0) {
62 return bb.get();
72 if (bb == null) {
86 if (bb == null) {
98 int length = Math.min(bb
[all...]
H A DEngineInputRecord.java189 CipherBox box, ByteBuffer bb) throws BadPaddingException {
198 int cipheredLength = bb.remaining();
210 box.decrypt(bb, tagLen);
222 bb.rewind();
227 int macOffset = bb.limit() - tagLen;
232 if (bb.remaining() < tagLen) {
240 bb.limit(cipheredLength);
244 if (checkMacTags(contentType(), bb, signer, false)) {
280 bb.limit(macOffset);
288 return bb
188 decrypt(MAC signer, CipherBox box, ByteBuffer bb) argument
296 checkMacTags(byte contentType, ByteBuffer bb, MAC signer, boolean isSimulated) argument
326 compareMacTags(ByteBuffer bb, byte[] tag) argument
[all...]
H A DEngineOutputRecord.java119 private void addMAC(MAC signer, ByteBuffer bb) argument
123 byte[] hash = signer.compute(contentType(), bb, false);
132 bb.limit(bb.limit() + hash.length);
133 bb.put(hash);
147 void encrypt(CipherBox box, ByteBuffer bb) { argument
148 box.encrypt(bb);
H A DCipherBox.java292 int encrypt(ByteBuffer bb) { argument
294 int len = bb.remaining();
297 bb.position(bb.limit());
302 int pos = bb.position();
313 int limit = bb.limit();
314 if (bb.hasArray()) {
315 int arrayOffset = bb.arrayOffset();
316 buf = bb.array();
320 bb
454 decrypt(ByteBuffer bb, int tagLen) argument
564 addPadding(ByteBuffer bb, int blockSize) argument
634 checkPadding(ByteBuffer bb, byte pad) argument
709 removePadding(ByteBuffer bb, int tagLen, int blockSize, ProtocolVersion protocolVersion) argument
[all...]
H A DMAC.java167 * On return, the bb position == limit, and limit will
171 * @param bb a ByteBuffer in which the position and limit
175 final byte[] compute(byte type, ByteBuffer bb, boolean isSimulated) { argument
176 return compute(type, bb, null, 0, bb.remaining(), isSimulated);
225 * Compute based on either buffer type, either bb.position/limit
228 private byte[] compute(byte type, ByteBuffer bb, byte[] buf, argument
246 if (bb != null) {
247 mac.update(bb);
/libcore/ojluni/src/main/java/java/nio/
H A DByteBufferAsDoubleBuffer.java33 protected final ByteBuffer bb; field in class:ByteBufferAsDoubleBuffer
37 ByteBufferAsDoubleBuffer(ByteBuffer bb, argument
41 this.bb = bb;
42 this.isReadOnly = bb.isReadOnly;
43 // There are only two possibilities for the type of ByteBuffer "bb", viz, DirectByteBuffer and
44 // HeapByteBuffer. We only have to initialize the field when bb is an instance of
50 if (bb instanceof DirectByteBuffer) {
51 this.address = bb.address + off;
64 return new ByteBufferAsDoubleBuffer(bb,
[all...]
H A DByteBufferAsFloatBuffer.java32 protected final ByteBuffer bb; field in class:ByteBufferAsFloatBuffer
36 ByteBufferAsFloatBuffer(ByteBuffer bb, argument
40 this.bb = bb;
41 this.isReadOnly = bb.isReadOnly;
42 // There are only two possibilities for the type of ByteBuffer "bb", viz, DirectByteBuffer and
43 // HeapByteBuffer. We only have to initialize the field when bb is an instance of
49 if (bb instanceof DirectByteBuffer) {
50 this.address = bb.address + off;
63 return new ByteBufferAsFloatBuffer(bb,
[all...]
H A DByteBufferAsIntBuffer.java32 protected final ByteBuffer bb; field in class:ByteBufferAsIntBuffer
36 ByteBufferAsIntBuffer(ByteBuffer bb, argument
40 this.bb = bb;
41 this.isReadOnly = bb.isReadOnly;
42 // There are only two possibilities for the type of ByteBuffer "bb", viz, DirectByteBuffer and
43 // HeapByteBuffer. We only have to initialize the field when bb is an instance of
49 if (bb instanceof DirectByteBuffer) {
50 this.address = bb.address + off;
63 return new ByteBufferAsIntBuffer(bb,
[all...]
H A DByteBufferAsLongBuffer.java32 protected final ByteBuffer bb; field in class:ByteBufferAsLongBuffer
36 ByteBufferAsLongBuffer(ByteBuffer bb, argument
40 this.bb = bb;
41 this.isReadOnly = bb.isReadOnly;
42 // There are only two possibilities for the type of ByteBuffer "bb", viz, DirectByteBuffer and
43 // HeapByteBuffer. We only have to initialize the field when bb is an instance of
49 if (bb instanceof DirectByteBuffer) {
50 this.address = bb.address + off;
63 return new ByteBufferAsLongBuffer(bb,
[all...]
H A DByteBufferAsShortBuffer.java32 protected final ByteBuffer bb; field in class:ByteBufferAsShortBuffer
36 ByteBufferAsShortBuffer(ByteBuffer bb, argument
40 this.bb = bb;
41 this.isReadOnly = bb.isReadOnly;
42 // There are only two possibilities for the type of ByteBuffer "bb", viz, DirectByteBuffer and
43 // HeapByteBuffer. We only have to initialize the field when bb is an instance of
49 if (bb instanceof DirectByteBuffer) {
50 this.address = bb.address + off;
63 return new ByteBufferAsShortBuffer(bb,
[all...]
H A DByteBufferAsCharBuffer.java32 protected final ByteBuffer bb; field in class:ByteBufferAsCharBuffer
36 ByteBufferAsCharBuffer(ByteBuffer bb, argument
40 this.bb = bb;
41 this.isReadOnly = bb.isReadOnly;
42 // There are only two possibilities for the type of ByteBuffer "bb", viz, DirectByteBuffer and
43 // HeapByteBuffer. We only have to initialize the field when bb is an instance of
49 if (bb instanceof DirectByteBuffer) {
50 this.address = bb.address + off;
63 return new ByteBufferAsCharBuffer(bb,
[all...]
H A DBits.java69 static char getCharL(ByteBuffer bb, int bi) { argument
70 return makeChar(bb._get(bi + 1),
71 bb._get(bi));
79 static char getCharB(ByteBuffer bb, int bi) { argument
80 return makeChar(bb._get(bi),
81 bb._get(bi + 1));
89 static char getChar(ByteBuffer bb, int bi, boolean bigEndian) { argument
90 return bigEndian ? getCharB(bb, bi) : getCharL(bb, bi);
105 static void putCharL(ByteBuffer bb, in argument
115 putCharB(ByteBuffer bb, int bi, char x) argument
125 putChar(ByteBuffer bb, int bi, char x, boolean bigEndian) argument
146 getShortL(ByteBuffer bb, int bi) argument
156 getShortB(ByteBuffer bb, int bi) argument
166 getShort(ByteBuffer bb, int bi, boolean bigEndian) argument
182 putShortL(ByteBuffer bb, int bi, short x) argument
192 putShortB(ByteBuffer bb, int bi, short x) argument
202 putShort(ByteBuffer bb, int bi, short x, boolean bigEndian) argument
226 getIntL(ByteBuffer bb, int bi) argument
240 getIntB(ByteBuffer bb, int bi) argument
254 getInt(ByteBuffer bb, int bi, boolean bigEndian) argument
278 putIntL(ByteBuffer bb, int bi, int x) argument
292 putIntB(ByteBuffer bb, int bi, int x) argument
306 putInt(ByteBuffer bb, int bi, int x, boolean bigEndian) argument
335 getLongL(ByteBuffer bb, int bi) argument
357 getLongB(ByteBuffer bb, int bi) argument
379 getLong(ByteBuffer bb, int bi, boolean bigEndian) argument
419 putLongL(ByteBuffer bb, int bi, long x) argument
441 putLongB(ByteBuffer bb, int bi, long x) argument
463 putLong(ByteBuffer bb, int bi, long x, boolean bigEndian) argument
480 getFloatL(ByteBuffer bb, int bi) argument
488 getFloatB(ByteBuffer bb, int bi) argument
496 getFloat(ByteBuffer bb, int bi, boolean bigEndian) argument
504 putFloatL(ByteBuffer bb, int bi, float x) argument
512 putFloatB(ByteBuffer bb, int bi, float x) argument
520 putFloat(ByteBuffer bb, int bi, float x, boolean bigEndian) argument
537 getDoubleL(ByteBuffer bb, int bi) argument
545 getDoubleB(ByteBuffer bb, int bi) argument
553 getDouble(ByteBuffer bb, int bi, boolean bigEndian) argument
561 putDoubleL(ByteBuffer bb, int bi, double x) argument
569 putDoubleB(ByteBuffer bb, int bi, double x) argument
577 putDouble(ByteBuffer bb, int bi, double x, boolean bigEndian) argument
[all...]
/libcore/ojluni/src/main/java/sun/misc/
H A DCharacterEncoder.java210 private byte [] getBytes(ByteBuffer bb) { argument
221 if (bb.hasArray()) {
222 byte [] tmp = bb.array();
223 if ((tmp.length == bb.capacity()) &&
224 (tmp.length == bb.remaining())) {
226 bb.position(bb.limit());
236 buf = new byte[bb.remaining()];
241 bb.get(buf);
/libcore/luni/src/test/java/libcore/java/nio/charset/
H A DCharset_TestGenerator.java223 ByteBuffer bb = encoder.encode(cb);
224 // bb.rewind();
225 while (bb.hasRemaining()) {
226 out.consume(bb.get());
234 static void genDecoded (Charset charset, ByteBuffer bb) { argument
/libcore/ojluni/src/main/java/java/nio/channels/
H A DChannels.java75 private static void writeFullyImpl(WritableByteChannel ch, ByteBuffer bb) argument
78 while (bb.remaining() > 0) {
79 int n = ch.write(bb);
91 private static void writeFully(WritableByteChannel ch, ByteBuffer bb) argument
99 writeFullyImpl(ch, bb);
102 writeFullyImpl(ch, bb);
148 private ByteBuffer bb = null;
168 ByteBuffer bb = ((this.bs == bs)
169 ? this.bb
171 bb
[all...]
/libcore/ojluni/src/main/java/java/nio/charset/
H A DCharset.java841 * .decode(bb); </pre>
851 * @param bb The byte buffer to be decoded
855 public final CharBuffer decode(ByteBuffer bb) { argument
860 .decode(bb);
877 * .encode(bb); </pre>
/libcore/ojluni/src/main/java/java/util/
H A DBitSet.java251 * <br>{@code BitSet.valueOf(bb).get(n) == ((bb.get(bb.position()+n/8) & (1<<(n%8))) != 0)}
252 * <br>for all {@code n < 8 * bb.remaining()}.
257 * @param bb a byte buffer containing a little-endian representation
262 public static BitSet valueOf(ByteBuffer bb) { argument
263 bb = bb.slice().order(ByteOrder.LITTLE_ENDIAN);
265 for (n = bb.remaining(); n > 0 && bb
[all...]
/libcore/ojluni/src/main/java/sun/nio/cs/
H A DStreamDecoder.java225 private ByteBuffer bb; field in class:StreamDecoder
247 bb = ByteBuffer.allocateDirect(DEFAULT_BYTE_BUFFER_SIZE);
252 bb = ByteBuffer.allocate(DEFAULT_BYTE_BUFFER_SIZE);
254 bb.flip(); // So that bb is initially empty
262 this.bb = ByteBuffer.allocate(mbc < 0
267 bb.flip();
271 bb.compact();
277 int n = sun.nio.ch.ChannelInputStream.read(ch, bb);
282 int lim = bb
[all...]
H A DStreamEncoder.java163 private ByteBuffer bb; field in class:StreamEncoder
192 bb = ByteBuffer.allocateDirect(DEFAULT_BYTE_BUFFER_SIZE);
195 bb = ByteBuffer.allocate(DEFAULT_BYTE_BUFFER_SIZE);
204 this.bb = ByteBuffer.allocate(mbc < 0
210 bb.flip();
211 int lim = bb.limit();
212 int pos = bb.position();
218 if (ch.write(bb) != rem)
221 out.write(bb.array(), bb
[all...]

Completed in 312 milliseconds

12