comparison src/org/eclipse/jetty/io/View.java @ 1041:35e3c864d7a7

make View package local
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 04 Nov 2016 00:47:23 -0600
parents a7319f14ba1e
children dd71a59fcf72
comparison
equal deleted inserted replaced
1040:3e4949834f3e 1041:35e3c864d7a7
23 * indexes of the backing buffer. 23 * indexes of the backing buffer.
24 * 24 *
25 * 25 *
26 * 26 *
27 */ 27 */
28 public final class View extends AbstractBuffer 28 final class View extends AbstractBuffer
29 { 29 {
30 private Buffer _buffer; 30 private Buffer _buffer;
31 31
32 /** 32 View(Buffer buffer)
33 * @param buffer The <code>Buffer</code> on which we are presenting a <code>View</code>.
34 * @param mark The initial value of the {@link Buffer#markIndex mark index}
35 * @param get The initial value of the {@link Buffer#getIndex get index}
36 * @param put The initial value of the {@link Buffer#putIndex put index}
37 * @param access The access level - one of the constants from {@link Buffer}.
38 */
39 public View(Buffer buffer, int mark, int get, int put,int access)
40 { 33 {
41 super(access); 34 super( buffer.isReadOnly()?READONLY:READWRITE );
42 _buffer = buffer.buffer();
43 setPutIndex(put);
44 setGetIndex(get);
45 setMarkIndex(mark);
46 }
47
48 public View()
49 {
50 super(READWRITE);
51 }
52
53 /**
54 * Update view to buffer
55 */
56 public void update(Buffer buffer)
57 {
58 _access = READWRITE;
59 _buffer = buffer.buffer(); 35 _buffer = buffer.buffer();
60 setGetIndex(0); 36 setGetIndex(0);
61 setPutIndex(buffer.putIndex()); 37 setPutIndex(buffer.putIndex());
62 setGetIndex(buffer.getIndex()); 38 setGetIndex(buffer.getIndex());
63 setMarkIndex(buffer.markIndex()); 39 setMarkIndex(buffer.markIndex());
64 _access = buffer.isReadOnly()?READONLY:READWRITE;
65 } 40 }
41
66 42
67 @Override 43 @Override
68 public byte[] array() 44 public byte[] array()
69 { 45 {
70 return _buffer.array(); 46 return _buffer.array();