List of usage examples for java.nio CharBuffer allocate
public static CharBuffer allocate(int capacity)
From source file:Main.java
public static void main(String[] args) { CharBuffer cb1 = CharBuffer.allocate(5); cb1.put(2, 'j'); cb1.rewind();/*w w w . j a va2s . c o m*/ System.out.println(cb1.get(2)); }
From source file:Main.java
public static void main(String[] args) { CharBuffer cb1 = CharBuffer.allocate(50); cb1.append("java2s.com"); cb1.rewind();//from w w w . j a v a2 s . c om System.out.println(cb1.hasArray()); }
From source file:Main.java
public static void main(String[] args) { CharBuffer cb1 = CharBuffer.allocate(5); cb1.put(2, 'j'); cb1.rewind();// w w w . j a v a 2 s . co m System.out.println(cb1.length()); }
From source file:Main.java
public static void main(String[] args) { CharBuffer cb1 = CharBuffer.allocate(50); cb1.append("java2s.com"); cb1.rewind();/* w w w . j a va 2 s. com*/ System.out.println(cb1.toString()); }
From source file:Main.java
public static void main(String[] args) { CharBuffer cb1 = CharBuffer.allocate(5); cb1.put("java2s.com", 0, 2); cb1.rewind();/* ww w. j a va 2 s. c o m*/ System.out.println(cb1.toString()); }
From source file:Main.java
public static void main(String[] args) { CharBuffer cb1 = CharBuffer.allocate(50); cb1.append("java2s.com"); cb1.rewind();/* w ww . j a v a2 s.co m*/ System.out.println(cb1.hashCode()); }
From source file:Main.java
public static void main(String[] args) { CharBuffer cb1 = CharBuffer.allocate(5); cb1.put(new char[] { 'j', 'a', 'v', 'a', '2', 's', '.', 'c', 'o', 'm', }); cb1.rewind();/* w w w. ja v a 2 s . com*/ System.out.println(cb1.toString()); }
From source file:Main.java
public static void main(String[] args) { CharBuffer cb1 = CharBuffer.allocate(5); cb1.put(2, 'j'); cb1.rewind();//from w w w . j a va 2 s . com System.out.println(cb1.order()); }
From source file:Main.java
public static void main(String[] args) { CharBuffer cb1 = CharBuffer.allocate(50); cb1.append("java2s.com"); cb1.rewind();// w w w.jav a2 s. com System.out.println(cb1.isDirect()); }
From source file:Main.java
public static void main(String[] args) { CharBuffer cb1 = CharBuffer.allocate(5); cb1.put("java2s.com"); cb1.rewind();//from w w w . j a v a2s.co m System.out.println(cb1.toString()); }