Examples of ZkMarshallingError


Examples of org.I0Itec.zkclient.exception.ZkMarshallingError

        Writable instance = _writableClass.newInstance();
        instance.readFields(buffer);
        buffer.close();
        return instance;
      } catch (Exception e) {
        throw new ZkMarshallingError(e);
      }
    }
View Full Code Here

Examples of org.I0Itec.zkclient.exception.ZkMarshallingError

      DataOutputBuffer out = new DataOutputBuffer();
      try {
        ((Writable) data).write(out);
        return out.getData();
      } catch (Exception e) {
        throw new ZkMarshallingError(e);
      } finally {
        IOUtils.closeStream(out);
      }
    }
View Full Code Here

Examples of org.I0Itec.zkclient.exception.ZkMarshallingError

                return (byte[]) data;
            } else {
                return ((String) data).getBytes("utf-8");
            }
        } catch (final UnsupportedEncodingException e) {
            throw new ZkMarshallingError(e);
        }
    }
View Full Code Here

Examples of org.I0Itec.zkclient.exception.ZkMarshallingError

    public Object deserialize(final byte[] bytes) throws ZkMarshallingError {
        try {
            return new String(bytes, "utf-8");
        } catch (final UnsupportedEncodingException e) {
            throw new ZkMarshallingError(e);
        }
    }
View Full Code Here

Examples of org.I0Itec.zkclient.exception.ZkMarshallingError

    public byte[] serialize(final Object data) throws ZkMarshallingError {
        try {
            return ((String) data).getBytes("utf-8");
        } catch (final UnsupportedEncodingException e) {
            throw new ZkMarshallingError(e);
        }
    }
View Full Code Here

Examples of org.I0Itec.zkclient.exception.ZkMarshallingError

        try {
            ObjectInputStream inputStream = new ObjectInputStream(new ByteArrayInputStream(bytes));
            Object object = inputStream.readObject();
            return object;
        } catch (ClassNotFoundException e) {
            throw new ZkMarshallingError("Unable to find object class.", e);
        } catch (IOException e) {
            throw new ZkMarshallingError(e);
        }
    }
View Full Code Here

Examples of org.I0Itec.zkclient.exception.ZkMarshallingError

            ObjectOutputStream stream = new ObjectOutputStream(byteArrayOS);
            stream.writeObject(serializable);
            stream.close();
            return byteArrayOS.toByteArray();
        } catch (IOException e) {
            throw new ZkMarshallingError(e);
        }
    }
View Full Code Here

Examples of org.I0Itec.zkclient.exception.ZkMarshallingError

                return (byte[]) data;
            } else {
                return ((String) data).getBytes("utf-8");
            }
        } catch (final UnsupportedEncodingException e) {
            throw new ZkMarshallingError(e);
        }
    }
View Full Code Here

Examples of org.I0Itec.zkclient.exception.ZkMarshallingError

    public Object deserialize(final byte[] bytes) throws ZkMarshallingError {
        try {
            return new String(bytes, "utf-8");
        } catch (final UnsupportedEncodingException e) {
            throw new ZkMarshallingError(e);
        }
    }
View Full Code Here

Examples of org.I0Itec.zkclient.exception.ZkMarshallingError

    public byte[] serialize(final Object data) throws ZkMarshallingError {
        try {
            return ((String) data).getBytes("utf-8");
        } catch (final UnsupportedEncodingException e) {
            throw new ZkMarshallingError(e);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.