comparison src/org/eclipse/jetty/io/ByteArrayBuffer.java @ 1039:a7319f14ba1e

remove Buffer.isImmutable()
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 03 Nov 2016 22:55:28 -0600
parents b71ad168fe34
children dd71a59fcf72
comparison
equal deleted inserted replaced
1038:b71ad168fe34 1039:a7319f14ba1e
48 this(bytes, index, length, READWRITE); 48 this(bytes, index, length, READWRITE);
49 } 49 }
50 50
51 public ByteArrayBuffer(byte[] bytes, int index, int length, int access) 51 public ByteArrayBuffer(byte[] bytes, int index, int length, int access)
52 { 52 {
53 super(READWRITE); 53 super(access);
54 _bytes = bytes; 54 _bytes = bytes;
55 setPutIndex(index + length); 55 setPutIndex(index + length);
56 setGetIndex(index); 56 setGetIndex(index);
57 _access = access;
58 } 57 }
59 58
60 public ByteArrayBuffer(int size) 59 public ByteArrayBuffer(int size)
61 { 60 {
62 this(new byte[size], 0, 0, READWRITE); 61 this(new byte[size], 0, 0, READWRITE);
63 setPutIndex(0); 62 setPutIndex(0);
64 } 63 }
65 64
66 public ByteArrayBuffer(String value) 65 public ByteArrayBuffer(String value)
67 { 66 {
68 super(READWRITE); 67 super(READONLY);
69 _bytes = StringUtil.getBytes(value); 68 _bytes = StringUtil.getBytes(value);
70 setGetIndex(0); 69 setGetIndex(0);
71 setPutIndex(_bytes.length); 70 setPutIndex(_bytes.length);
72 _access=IMMUTABLE;
73 _string = value;
74 } 71 }
75 72
76 @Override 73 @Override
77 public final byte[] array() 74 public final byte[] array()
78 { 75 {