rename some SerializePacked methods

This commit is contained in:
David Renshaw 2014-10-10 13:34:32 -04:00
parent 8cc1cfa60c
commit cc5ec73ef5
2 changed files with 7 additions and 7 deletions

View file

@ -57,14 +57,14 @@ public class AddressbookMain {
bobPhones.get(1).setType(Person.PhoneNumber.Type.WORK); bobPhones.get(1).setType(Person.PhoneNumber.Type.WORK);
bob.getEmployment().setUnemployed(org.capnproto.Void.VOID); bob.getEmployment().setUnemployed(org.capnproto.Void.VOID);
org.capnproto.SerializePacked.writeUnbuffered( org.capnproto.SerializePacked.writeToUnbuffered(
(new FileOutputStream(FileDescriptor.out)).getChannel(), (new FileOutputStream(FileDescriptor.out)).getChannel(),
message); message);
} }
public static void printAddressBook() throws java.io.IOException { public static void printAddressBook() throws java.io.IOException {
org.capnproto.MessageReader message = org.capnproto.MessageReader message =
org.capnproto.SerializePacked.readUnbuffered( org.capnproto.SerializePacked.readFromUnbuffered(
(new FileInputStream(FileDescriptor.in)).getChannel()); (new FileInputStream(FileDescriptor.in)).getChannel());
AddressBook.Reader addressbook = message.getRoot(AddressBook.factory); AddressBook.Reader addressbook = message.getRoot(AddressBook.factory);
for(Person.Reader person : addressbook.getPeople()) { for(Person.Reader person : addressbook.getPeople()) {

View file

@ -32,11 +32,11 @@ public final class SerializePacked {
return Serialize.read(packedInput, options); return Serialize.read(packedInput, options);
} }
public static MessageReader readUnbuffered(java.nio.channels.ReadableByteChannel input) throws java.io.IOException { public static MessageReader readFromUnbuffered(java.nio.channels.ReadableByteChannel input) throws java.io.IOException {
return readUnbuffered(input, ReaderOptions.DEFAULT_READER_OPTIONS); return readFromUnbuffered(input, ReaderOptions.DEFAULT_READER_OPTIONS);
} }
public static MessageReader readUnbuffered(java.nio.channels.ReadableByteChannel input, public static MessageReader readFromUnbuffered(java.nio.channels.ReadableByteChannel input,
ReaderOptions options) throws java.io.IOException { ReaderOptions options) throws java.io.IOException {
PackedInputStream packedInput = new PackedInputStream(new BufferedInputStreamWrapper(input)); PackedInputStream packedInput = new PackedInputStream(new BufferedInputStreamWrapper(input));
return Serialize.read(packedInput, options); return Serialize.read(packedInput, options);
@ -48,7 +48,7 @@ public final class SerializePacked {
Serialize.write(packedOutputStream, message); Serialize.write(packedOutputStream, message);
} }
public static void writeUnbuffered(java.nio.channels.WritableByteChannel output, public static void writeToUnbuffered(java.nio.channels.WritableByteChannel output,
MessageBuilder message) throws java.io.IOException { MessageBuilder message) throws java.io.IOException {
BufferedOutputStreamWrapper buffered = new BufferedOutputStreamWrapper(output); BufferedOutputStreamWrapper buffered = new BufferedOutputStreamWrapper(output);
write(buffered, message); write(buffered, message);