mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-05-29 10:24:46 +00:00
format everything
This commit is contained in:
@@ -18,8 +18,7 @@ ByteArrayOutputStream::ByteArrayOutputStream(unsigned int size) {
|
||||
buf = std::vector<uint8_t>(size);
|
||||
}
|
||||
|
||||
ByteArrayOutputStream::~ByteArrayOutputStream() {
|
||||
}
|
||||
ByteArrayOutputStream::~ByteArrayOutputStream() {}
|
||||
|
||||
// Writes the specified byte to this byte array output stream.
|
||||
// Parameters:
|
||||
@@ -35,18 +34,21 @@ void ByteArrayOutputStream::write(unsigned int b) {
|
||||
// Writes b.size() bytes from the specified byte array to this output stream.
|
||||
// The general contract for write(b) is that it should have exactly the same
|
||||
// effect as the call write(b, 0, b.size()).
|
||||
void ByteArrayOutputStream::write(const std::vector<uint8_t>& b) { write(b, 0, b.size()); }
|
||||
void ByteArrayOutputStream::write(const std::vector<uint8_t>& b) {
|
||||
write(b, 0, b.size());
|
||||
}
|
||||
|
||||
// Writes len bytes from the specified byte array starting at offset off to this
|
||||
// byte array output stream. Parameters: b - the data. off - the start offset in
|
||||
// the data. len - the number of bytes to write.
|
||||
void ByteArrayOutputStream::write(const std::vector<uint8_t>& b, unsigned int offset,
|
||||
unsigned int length) {
|
||||
void ByteArrayOutputStream::write(const std::vector<uint8_t>& b,
|
||||
unsigned int offset, unsigned int length) {
|
||||
assert(b.size() >= offset + length);
|
||||
|
||||
// If we will fill the buffer we need to make it bigger
|
||||
if (count + length >= buf.size())
|
||||
buf.resize(std::max(count + length + 1, (unsigned int)(buf.size() * 2)));
|
||||
buf.resize(
|
||||
std::max(count + length + 1, (unsigned int)(buf.size() * 2)));
|
||||
|
||||
std::memcpy(&buf[count], &b[offset], length);
|
||||
// std::copy( b->data+offset, b->data+offset+length, buf->data + count ); //
|
||||
|
||||
Reference in New Issue
Block a user