Rename BlockHeader to BlobHeader

This commit is contained in:
Scott Crosby 2010-12-21 11:39:02 -06:00
parent 2b9b791603
commit f0ea2798ed
4 changed files with 6 additions and 6 deletions

View File

@ -11,7 +11,7 @@ import java.util.zip.Deflater;
import com.google.protobuf.ByteString; import com.google.protobuf.ByteString;
import crosby.binary.Fileformat; import crosby.binary.Fileformat;
import crosby.binary.Fileformat.BlockHeader; import crosby.binary.Fileformat.BlobHeader;
/** A full fileblock object contains both the metadata and data of a fileblock */ /** A full fileblock object contains both the metadata and data of a fileblock */
public class FileBlock extends FileBlockBase { public class FileBlock extends FileBlockBase {
@ -71,7 +71,7 @@ public class FileBlock extends FileBlockBase {
public FileBlockPosition writeTo(OutputStream outwrite, CompressFlags flags) public FileBlockPosition writeTo(OutputStream outwrite, CompressFlags flags)
throws IOException { throws IOException {
BlockHeader.Builder builder = Fileformat.BlockHeader BlobHeader.Builder builder = Fileformat.BlobHeader
.newBuilder(); .newBuilder();
if (indexdata != null) if (indexdata != null)
builder.setIndexdata(indexdata); builder.setIndexdata(indexdata);
@ -91,7 +91,7 @@ public class FileBlock extends FileBlockBase {
Fileformat.Blob blob = blobbuilder.build(); Fileformat.Blob blob = blobbuilder.build();
builder.setDatasize(blob.getSerializedSize()); builder.setDatasize(blob.getSerializedSize());
Fileformat.BlockHeader message = builder.build(); Fileformat.BlobHeader message = builder.build();
int size = message.getSerializedSize(); int size = message.getSerializedSize();
// System.out.format("Outputed header size %d bytes, header of %d bytes, and blob of %d bytes\n", // System.out.format("Outputed header size %d bytes, header of %d bytes, and blob of %d bytes\n",

View File

@ -36,7 +36,7 @@ public class FileBlockHead extends FileBlockReference {
byte buf[] = new byte[headersize]; byte buf[] = new byte[headersize];
datinput.readFully(buf); datinput.readFully(buf);
// System.out.format("Read buffer for header of %d bytes\n",buf.length); // System.out.format("Read buffer for header of %d bytes\n",buf.length);
Fileformat.BlockHeader header = Fileformat.BlockHeader Fileformat.BlobHeader header = Fileformat.BlobHeader
.parseFrom(buf); .parseFrom(buf);
FileBlockHead fileblock = new FileBlockHead(header.getType(), header FileBlockHead fileblock = new FileBlockHead(header.getType(), header
.getIndexdata()); .getIndexdata());

View File

@ -9,7 +9,7 @@ import java.util.Collections;
import com.google.protobuf.ByteString; import com.google.protobuf.ByteString;
import crosby.binary.Fileformat.Blob; import crosby.binary.Fileformat.Blob;
import crosby.binary.Fileformat.BlockHeader; import crosby.binary.Fileformat.BlobHeader;
import crosby.binary.Osmformat.DenseNodes; import crosby.binary.Osmformat.DenseNodes;
import crosby.binary.Osmformat.HeaderBlock; import crosby.binary.Osmformat.HeaderBlock;
import crosby.binary.Osmformat.Info; import crosby.binary.Osmformat.Info;

View File

@ -27,7 +27,7 @@ their length in network byte order, followed by a data block
containing the actual data. types staring with a "_" are reserved. containing the actual data. types staring with a "_" are reserved.
*/ */
message BlockHeader { message BlobHeader {
required string type = 1; required string type = 1;
optional bytes indexdata = 2; optional bytes indexdata = 2;
required int32 datasize = 3; required int32 datasize = 3;