public void writeUTF(String v) throws IOException { hessian2Output.writeString(v); }
/** * Writes the method tag. * * <code><pre> * string * </pre></code> * * @param method the method name to call. */ public void writeMethod(String method) throws IOException { writeString(method); }
/** * Writes the method tag. * * <code><pre> * string * </pre></code> * * @param method the method name to call. */ public void writeMethod(String method) throws IOException { writeString(method); }
/** * Writes the method tag. * * <code><pre> * string * </pre></code> * * @param method the method name to call. */ public void writeMethod(String method) throws IOException { writeString(method); }
/** * Writes the method tag. * * <code><pre> * string * </pre></code> * * @param method the method name to call. */ public void writeMethod(String method) throws IOException { writeString(method); }
private void writeAddress(Hessian2Output out, String address) throws IOException { if (address == null) { out.writeString(null); return; } Integer value = _addressCache.get(address); if (value != null) out.writeInt(value); else { out.writeString(address); int index = _addressCacheIndex; _addressCacheIndex = (index + 1) % _addressCacheRing.length; if (_addressCacheRing[index] != null) { _addressCache.remove(_addressCacheRing[index]); } _addressCacheRing[index] = address; _addressCache.put(address, index); } }
/** * Starts an envelope. * * <code><pre> * E major minor * m b16 b8 method-name * </pre></code> * * @param method the method name to call. */ public void startEnvelope(String method) throws IOException { int offset = _offset; if (SIZE < offset + 32) { flushBuffer(); offset = _offset; } _buffer[_offset++] = (byte) 'E'; writeString(method); }
/** * Starts an envelope. * * <code><pre> * E major minor * m b16 b8 method-name * </pre></code> * * @param method the method name to call. */ public void startEnvelope(String method) throws IOException { int offset = _offset; if (SIZE < offset + 32) { flushBuffer(); offset = _offset; } _buffer[_offset++] = (byte) 'E'; writeString(method); }
/** * Starts an envelope. * * <code><pre> * E major minor * m b16 b8 method-name * </pre></code> * * @param method the method name to call. */ public void startEnvelope(String method) throws IOException { int offset = _offset; if (SIZE < offset + 32) { flushBuffer(); offset = _offset; } _buffer[_offset++] = (byte) 'E'; writeString(method); }
/** * Starts an envelope. * * <code><pre> * E major minor * m b16 b8 method-name * </pre></code> * * @param method the method name to call. */ public void startEnvelope(String method) throws IOException { int offset = _offset; if (SIZE < offset + 32) { flush(); offset = _offset; } _buffer[_offset++] = (byte) 'E'; writeString(method); }
/** * <code><pre> * type ::= string * ::= int * </code></pre> */ private void writeType(String type) throws IOException { flushIfFull(); int len = type.length(); if (len == 0) { throw new IllegalArgumentException("empty type is not allowed"); } if (_typeRefs == null) _typeRefs = new HashMap<String,Integer>(); Integer typeRefV = (Integer) _typeRefs.get(type); if (typeRefV != null) { int typeRef = typeRefV.intValue(); writeInt(typeRef); } else { _typeRefs.put(type, Integer.valueOf(_typeRefs.size())); writeString(type); } }
/** * <code><pre> * type ::= string * ::= int * </code></pre> */ private void writeType(String type) throws IOException { flushIfFull(); int len = type.length(); if (len == 0) { throw new IllegalArgumentException("empty type is not allowed"); } if (_typeRefs == null) _typeRefs = new HashMap(); Integer typeRefV = (Integer) _typeRefs.get(type); if (typeRefV != null) { int typeRef = typeRefV.intValue(); writeInt(typeRef); } else { _typeRefs.put(type, Integer.valueOf(_typeRefs.size())); writeString(type); } }
/** * Serialize the body to an output stream. */ @Override public void writeBody(OutputStream os) throws IOException { if (_text == null) return; Hessian2Output out = new Hessian2Output(os); out.writeString(_text); out.close(); }
/** * <code><pre> * type ::= string * ::= int * </code></pre> */ private void writeType(String type) throws IOException { flushIfFull(); int len = type.length(); if (len == 0) { throw new IllegalArgumentException("empty type is not allowed"); } if (_typeRefs == null) _typeRefs = new HashMap<String,Integer>(); Integer typeRefV = (Integer) _typeRefs.get(type); if (typeRefV != null) { int typeRef = typeRefV.intValue(); writeInt(typeRef); } else { _typeRefs.put(type, Integer.valueOf(_typeRefs.size())); writeString(type); } }
public void close() throws IOException { Hessian2Output out = _out; _out = null; if (out == null) return; _bodyOut.close(); byte []sig = _mac.doFinal(); out.writeInt(1); out.writeString("signature"); out.writeBytes(sig); out.completeEnvelope(); out.close(); } }
public void close() throws IOException { Hessian2Output out = _out; _out = null; if (out == null) return; _bodyOut.close(); byte []sig = _mac.doFinal(); out.writeInt(1); out.writeString("signature"); out.writeBytes(sig); out.completeEnvelope(); out.close(); } }
public void close() throws IOException { Hessian2Output out = _out; _out = null; if (out == null) return; _bodyOut.close(); byte[] sig = _mac.doFinal(); out.writeInt(1); out.writeString("signature"); out.writeBytes(sig); out.completeEnvelope(); out.close(); } }
/** * Starts the method call. Clients would use <code>startCall</code> * instead of <code>call</code> if they wanted finer control over * writing the arguments, or needed to write headers. * * <code><pre> * C * string # method name * int # arg count * </pre></code> * * @param method the method name to call. */ public void startCall(String method, int length) throws IOException { int offset = _offset; if (SIZE < offset + 32) { flush(); offset = _offset; } byte []buffer = _buffer; buffer[_offset++] = (byte) 'C'; writeString(method); writeInt(length); }
/** * Starts the method call. Clients would use <code>startCall</code> * instead of <code>call</code> if they wanted finer control over * writing the arguments, or needed to write headers. * * <code><pre> * C * string # method name * int # arg count * </pre></code> * * @param method the method name to call. */ @Override public void startCall(String method, int length) throws IOException { int offset = _offset; if (SIZE < offset + 32) { flushBuffer(); offset = _offset; } byte []buffer = _buffer; buffer[_offset++] = (byte) 'C'; writeString(method); writeInt(length); }
/** * Starts the method call. Clients would use <code>startCall</code> * instead of <code>call</code> if they wanted finer control over * writing the arguments, or needed to write headers. * * <code><pre> * C * string # method name * int # arg count * </pre></code> * * @param method the method name to call. */ @Override public void startCall(String method, int length) throws IOException { int offset = _offset; if (SIZE < offset + 32) { flushBuffer(); offset = _offset; } byte[] buffer = _buffer; buffer[_offset++] = (byte) 'C'; writeString(method); writeInt(length); }