Package java.nio

Examples of java.nio.ByteOrder


                serializationConfig.setCheckClassDefErrors(checkTrue(value));
            } else if ("use-native-byte-order".equals(name)) {
                serializationConfig.setUseNativeByteOrder(checkTrue(getTextContent(child)));
            } else if ("byte-order".equals(name)) {
                String value = getTextContent(child);
                ByteOrder byteOrder = null;
                if (ByteOrder.BIG_ENDIAN.toString().equals(value)) {
                    byteOrder = ByteOrder.BIG_ENDIAN;
                } else if (ByteOrder.LITTLE_ENDIAN.toString().equals(value)) {
                    byteOrder = ByteOrder.LITTLE_ENDIAN;
                }
View Full Code Here


        if (newCapacity > capacity()) {
            // Expand:
            //// Save the state.
            int pos = position();
            int limit = limit();
            ByteOrder bo = order();

            //// Reallocate.
            ByteBuffer oldBuf = buf();
            ByteBuffer newBuf = getAllocator().allocateNioBuffer(newCapacity,
                    isDirect());
View Full Code Here

            return this;
        }

        // Shrink and compact:
        //// Save the state.
        ByteOrder bo = order();

        //// Reallocate.
        ByteBuffer oldBuf = buf();
        ByteBuffer newBuf = getAllocator()
                .allocateNioBuffer(newCapacity, isDirect());
View Full Code Here

                return this;
            }

            // Shrink and compact:
            //// Save the state.
            ByteOrder bo = order();

            //// Sanity check.
            if (remaining > newCapacity) {
                throw new IllegalStateException(
                        "The amount of the remaining bytes is greater than "
View Full Code Here

        if (newCapacity > capacity()) {
            // Expand:
            //// Save the state.
            int pos = position();
            int limit = limit();
            ByteOrder bo = order();

            //// Reallocate.
            ByteBuffer oldBuf = buf();
            ByteBuffer newBuf =
                allocator.allocateNioBuffer(newCapacity, isDirect());
View Full Code Here

            return this;
        }

        // Shrink and compact:
        //// Save the state.
        ByteOrder bo = order();

        //// Reallocate.
        ByteBuffer oldBuf = buf();
        ByteBuffer newBuf =
            allocator.allocateNioBuffer(newCapacity, isDirect());
View Full Code Here

                return this;
            }

            // Shrink and compact:
            //// Save the state.
            ByteOrder bo = order();

            //// Sanity check.
            if (remaining > newCapacity) {
                throw new IllegalStateException(
                        "The amount of the remaining bytes is greater than " +
View Full Code Here

    char[] chs = s.toCharArray();
    writeChars(chs, 0, chs.length);
  }

  public void writeUTF(String s) throws IOException {
    ByteOrder byteOrder = getByteOrder();
    setByteOrder(ByteOrder.BIG_ENDIAN);
    ByteArrayOutputStream baos = new ByteArrayOutputStream();

    new DataOutputStream(baos).writeUTF(s);
    write(baos.toByteArray(), 0, baos.size());
View Full Code Here

    return isEmpty ? null : line.toString();
  }

  public String readUTF() throws IOException {
    ByteOrder byteOrder = getByteOrder();
    setByteOrder(ByteOrder.BIG_ENDIAN);
    final int size = readUnsignedShort();
    final byte[] buf = new byte[size];
    final char[] out = new char[size];
View Full Code Here

        if (newCapacity > capacity()) {
            // Expand:
            //// Save the state.
            int pos = position();
            int limit = limit();
            ByteOrder bo = order();

            //// Reallocate.
            ByteBuffer oldBuf = buf();
            ByteBuffer newBuf =
                allocator.allocateNioBuffer(newCapacity, isDirect());
View Full Code Here

TOP

Related Classes of java.nio.ByteOrder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.