1 7 8 package com.sun.corba.se.impl.encoding; 9 10 import java.nio.ByteBuffer ; 11 import com.sun.corba.se.spi.orb.ORB; 12 import com.sun.corba.se.spi.logging.CORBALogDomains; 13 import com.sun.corba.se.impl.protocol.giopmsgheaders.FragmentMessage; 14 import com.sun.corba.se.impl.protocol.giopmsgheaders.Message; 15 import com.sun.corba.se.impl.logging.ORBUtilSystemException; 16 17 public class BufferManagerReadGrow 18 implements BufferManagerRead, MarkAndResetHandler 19 { 20 private ORB orb ; 25 26 private ORBUtilSystemException wrapper ; 27 28 BufferManagerReadGrow( ORB orb ) 29 { 30 this.orb = orb ; 31 this.wrapper = ORBUtilSystemException.get( orb, 32 CORBALogDomains.RPC_ENCODING ) ; 33 } 34 35 public void processFragment (ByteBuffer byteBuffer, FragmentMessage header) 36 { 37 } 40 41 public void init(Message msg) {} 42 43 public ByteBufferWithInfo underflow (ByteBufferWithInfo bbwi) 44 { 45 throw wrapper.unexpectedEof() ; 46 } 47 48 public void cancelProcessing(int requestId) {} 49 50 52 private Object streamMemento; 53 private RestorableInputStream inputStream; 54 private boolean markEngaged = false; 55 56 public MarkAndResetHandler getMarkAndResetHandler() { 57 return this; 58 } 59 60 public void mark(RestorableInputStream is) { 61 markEngaged = true; 62 inputStream = is; 63 streamMemento = inputStream.createStreamMemento(); 64 } 65 66 public void fragmentationOccured(ByteBufferWithInfo newFragment) {} 68 69 public void reset() { 70 71 if (!markEngaged) 72 return; 73 74 markEngaged = false; 75 inputStream.restoreInternalState(streamMemento); 76 streamMemento = null; 77 } 78 79 public void close(ByteBufferWithInfo bbwi) {} 81 } 82 | Popular Tags |