Examples of asCharBuffer()


Examples of java.nio.ByteBuffer.asCharBuffer()

        if(byteBuffer.remaining() < byteLen) {
            throw new EOFException();
        }

        // Get the view Buffer.
        CharBuffer viewBuffer = byteBuffer.asCharBuffer();

        // Get the chars.
        viewBuffer.get(c, off, len);

        // Update the position.
View Full Code Here

Examples of java.nio.ByteBuffer.asCharBuffer()

    }

    buffer.position(0);
    buffer.asCharBuffer().put(modelPaths);
    buffer.position(modelPaths.length*2);
    buffer.asCharBuffer().put(materialPaths);
    //dos.writeChars(this.getAllModelPaths(models)+'\n'+this.getAllMaterialPaths()+'\n');
    dos.write(actual);
    dos.close();
   
    actual = null;
View Full Code Here

Examples of java.nio.ByteBuffer.asCharBuffer()

      }
      matIndex++;
    }

    buffer.position(0);
    buffer.asCharBuffer().put(modelPaths);
    buffer.position(modelPaths.length*2);
    buffer.asCharBuffer().put(materialPaths);
    //dos.writeChars(this.getAllModelPaths(models)+'\n'+this.getAllMaterialPaths()+'\n');
    dos.write(actual);
    dos.close();
 
View Full Code Here

Examples of java.nio.ByteBuffer.asCharBuffer()

    ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
    ReadableByteChannel channel = Channels.newChannel(bais);
    ByteBuffer buf = ByteBuffer.allocate(10);
    channel.read(buf);
    buf.flip();
    CharBuffer cbuf = buf.asCharBuffer();
    char[] c = new char[5];
    cbuf.get(c);
    String s = String.valueOf(c);
    assertEquals("Hello", s);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.